<!DOCTYPE HTML>
<html>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  <head>
    
    
    <title></title>
	<script type="text/javascript" src="js/include.js"></script>
	<script type="text/javascript">
		
		function submitForm(){
			$.cookie('token', '', { expires: -1 });
			if($("#ff").form('validate')==true){
				$.ajax({   
				     url:url+"/login",
				     type:$("#ff").attr("method"),   
				     data:$("#ff").serializeArray(),
						success: function(data, textStatus, jqXHR) {

							 $.cookie('token', "Bearer "+jqXHR.getResponseHeader("Authorization"));
							 window.location=htmlURL+"/index.html";

				     }
				});
			}
			
		}
		function clearForm(){
			$('#ff').form('clear');
		}
	</script>
  </head>
  
  <body>
 
   <div id="login-dialog" class="easyui-dialog" title="登录" style="width:auto;height:auto;"
     data-options="iconCls:'icon-login-user',resizable:false,modal:false,closable:false,draggable:false">
		<form id="ff" style="padding:10px 20px 10px 40px;"  method="post">
			<p>账号: <input type="text" name="username" value="wangsong" class="easyui-textbox" required="true"></p>
			<p>密码: <input type="password"  name="password" value="wangsong" class="easyui-textbox" required="true"></p>

			<div style="padding:5px;text-align:center;">
				
				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
		    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">重置</a>
			</div>
		</form>
	</div>
  </body>
</html>
